<?php defined('IN_KG') or exit('Access Invalid!');?>

<div class="alert alert-block mt10">
    <ul class="mt5">
        <li>1、填写用户ID和优惠券码，提交后，直接将优惠券发送至用户账号中。</li>
    </ul>
</div>
<div class="ncsc-form-default">
<form id="send_form" action="index.php?control=store_redpacket&amp;op=redpacket_send" method="post">
    <dl>
        <dt><i class="required">*</i>用户ID：</dt>
        <dd>
            <input id="member_id" name="member_id" type="text" maxlength="25" class="w400 text">
            <span class="error-message"></span>
        </dd>
    </dl>
    <dl>
        <dt><i class="required">*</i>优惠码：</dt>
        <dd>
            <input id="rpt_code" name="pwd_code" type="text" maxlength="25" class="w400 text">
            <span class="error-message"></span>
        </dd>
    </dl>
    <div class="bottom">
        <label class="submit-border">
            <input id="submit_button" type="submit" value="提交" class="submit">
        </label>
    </div>
</form>
</div>


<script>
    $("#send_form").validate({
        errorPlacement: function(error, element) {
            var error_td = element.parent('dd').children('span.error-message');
            error_td.append(error);
        },
        onfocusout: false,
        submitHandler: function(form) {
            ajaxpost('send_form', '', '', 'onerror');
        },
        rules: {
            member_id: {
                required: true
            },
            rpt_code: {
                required: true,
            }
        },
        messages: {
            member_id: {
                required: '<i class="icon-exclamation-sign"></i>请输入用户ID'
            },
            rpt_code: {
                required: '<i class="icon-exclamation-sign"></i>请输入发送的优惠券的优惠码',
            }
        }
    });

</script>
